<?php
//define role names
define('WIKI_SYSOP', 'WikiSysOp');

define('AE_ENSIGN', '[AGONY] Ensign');
define('AE_LIEUTENANT', '[AGONY] Lieutenant');
define('AE_LT_COMMANDER', '[AGONY] Lt. Commander');
define('AE_COMMANDER', '[AGONY] Commander');
define('AE_CAPTAIN', '[AGONY] Captain');
define('AE_VICE_ADMIRAL', '[AGONY] Vice Admiral');
define('AE_SQUADRON_ADMIRAL', '[AGONY] Squadron Admiral');
define('AE_OPS_ADMIRAL', '[AGONY] Operations Admiral');
define('AE_DIRECTOR', '[AGONY] Director');

define('AE_ALPHA_MEMBER', '[AGONY] Alpha Member');
define('AE_ALPHA_LEADER', '[AGONY] Alpha Leader');
define('AE_BRAVO_MEMBER', '[AGONY] Bravo Member');
define('AE_BRAVO_LEADER', '[AGONY] Bravo Leader');
define('AE_CHARLIE_MEMBER', '[AGONY] Charlie Member');
define('AE_CHARLIE_LEADER', '[AGONY] Charlie Leader');
define('AE_DELTA_MEMBER', '[AGONY] Delta Member');
define('AE_DELTA_LEADER', '[AGONY] Delta Leader');
define('AE_ECHO_MEMBER', '[AGONY] Echo Member');
define('AE_ECHO_LEADER', '[AGONY] Echo Leader');

define('AE_BASIC_STUDENT', '[PVPU] Basic Student');
define('AE_BASIC_INSTRUCTOR', '[PVPU] Basic Instructor');
define('AE_WOLFPACKS_STUDENT', '[PVPU] Wolfpacks Student');
define('AE_WOLFPACKS_INSTRUCTOR', '[PVPU] Wolfpacks Instructor');
define('AE_COVOPS_STUDENT', '[PVPU] Covops Student');
define('AE_COVOPS_INSTRUCTOR', '[PVPU] Basic Instructor');
define('AE_FLYBYS_STUDENT', '[PVPU] Flybys Student');
define('AE_FLYBYS_INSTRUCTOR', '[PVPU] Flybys Instructor');
define('AE_ADVANCED_STUDENT', '[PVPU] Advanced Student');
define('AE_ADVANCED_INSTRUCTOR', '[PVPU] Advanced Instructor');

// Disable robot indexing of all but NS_MAIN and NS_HELP
$wgNamespaceRobotPolicies[NS_TALK] = 'noindex,nofollow';
$wgNamespaceRobotPolicies[NS_USER] = 'noindex,nofollow';
$wgNamespaceRobotPolicies[NS_USER_TALK] = 'noindex,nofollow';
$wgNamespaceRobotPolicies[NS_PROJECT] = 'noindex,nofollow';
$wgNamespaceRobotPolicies[NS_PROJECT_TALK] = 'noindex,nofollow';
$wgNamespaceRobotPolicies[NS_IMAGE] = 'noindex,nofollow';
$wgNamespaceRobotPolicies[NS_IMAGE_TALK] = 'noindex,nofollow';
$wgNamespaceRobotPolicies[NS_MEDIAWIKI] = 'noindex,nofollow';
$wgNamespaceRobotPolicies[NS_MEDIAWIKI_TALK] = 'noindex,nofollow';
$wgNamespaceRobotPolicies[NS_TEMPLATE] = 'noindex,nofollow';
$wgNamespaceRobotPolicies[NS_TEMPLATE_TALK] = 'noindex,nofollow';
$wgNamespaceRobotPolicies[NS_HELP_TALK] = 'noindex,nofollow';
$wgNamespaceRobotPolicies[NS_CATEGORY] = 'noindex,nofollow';
$wgNamespaceRobotPolicies[NS_CATEGORY_TALK] = 'noindex,nofollow';

// Prevent transclusion of all but Image and Template namespaces.
$wgNonincludableNamespaces[] = NS_MAIN;
$wgNonincludableNamespaces[] = NS_TALK;
$wgNonincludableNamespaces[] = NS_USER;
$wgNonincludableNamespaces[] = NS_USER_TALK;
$wgNonincludableNamespaces[] = NS_PROJECT;
$wgNonincludableNamespaces[] = NS_PROJECT_TALK;
$wgNonincludableNamespaces[] = NS_IMAGE_TALK;
$wgNonincludableNamespaces[] = NS_MEDIAWIKI;
$wgNonincludableNamespaces[] = NS_MEDIAWIKI_TALK;
$wgNonincludableNamespaces[] = NS_TEMPLATE_TALK;
$wgNonincludableNamespaces[] = NS_HELP;
$wgNonincludableNamespaces[] = NS_HELP_TALK;
$wgNonincludableNamespaces[] = NS_CATEGORY;
$wgNonincludableNamespaces[] = NS_CATEGORY_TALK;

// Don't show anonymous user's IP address in header
$wgShowIPinHeader = false;

// Prevent Special: pages from being included in other pages.
$wgAllowSpecialInclusion = false;

// Prevent use of the MediaWiki API (unknown security risks if enabled)
$wgEnableAPI = false;

// Don't include image gallery oin category view
$wgCategoryMagicGallery = false;

// Prevent other sites from wrapping our site in a frame.
$wgBreakFrames = true;

/**
 * Rights which can be required for each protection level (via action=protect)
 *
 * You can add a new protection level that requires a specific
 * permission by manipulating this array. The ordering of elements
 * dictates the order on the protection form's lists.
 *
 * '' will be ignored (i.e. unprotected)
 * 'sysop' is quietly rewritten to 'protect' for backwards compatibility
 */
$wgRestrictionLevels = array( '', 'sysop' );

// Public content
$wgAccessControlCategories['Category:Public'] = true;

// Content restricted to Agony members
$wgAccessControlCategories['Category:Agony'] = true;

// Content restricted to lt_commander and above
$wgAccessControlCategories['Category:Agony/Restricted'] = true;

// Content restricted to Captains and above
$wgAccessControlCategories['Category:Agony/Leadership'] = true;

// Content restricted to Vice Admirals and Above
$wgAccessControlCategories['Category:Agony/Leadership/Senior'] = true;

// Content restricted to a certain rank
$wgAccessControlCategories['Category:Agony/Ensign'] = true;
$wgAccessControlCategories['Category:Agony/Lieutenant'] = true;
$wgAccessControlCategories['Category:Agony/LtCommander'] = true;
$wgAccessControlCategories['Category:Agony/Commander'] = true;
$wgAccessControlCategories['Category:Agony/Captain'] = true;
$wgAccessControlCategories['Category:Agony/ViceAdmiral'] = true;
$wgAccessControlCategories['Category:Agony/SquadronAdmiral'] = true;
$wgAccessControlCategories['Category:Agony/OperationsAdmiral'] = true;

// Content restricted to Directors
$wgAccessControlCategories['Category:Agony/Director'] = true;

$wgAccessControlCategories['Category:Agony/CEO'] = true;

// Content restricted to Alpha Squadron Members
$wgAccessControlCategories['Category:Agony/Alpha'] = true;
// Content restricted to Alpha Squadron Admiral
$wgAccessControlCategories['Category:Agony/Alpha/Leadership'] = true;

// Content restricted to Bravo Squadron Members
$wgAccessControlCategories['Category:Agony/Bravo'] = true;
// Content restricted to Bravo Squadron Admiral
$wgAccessControlCategories['Category:Agony/Bravo/Leadership'] = true;

// Content restricted to Charlie Squadron Members
$wgAccessControlCategories['Category:Agony/Charlie'] = true;
// Content restricted to Charlie Squadron Admiral
$wgAccessControlCategories['Category:Agony/Charlie/Leadership'] = true;

// Content restricted to Delta Squadron Members
$wgAccessControlCategories['Category:Agony/Delta'] = true;
// Content restricted to Delta Squadron Admiral
$wgAccessControlCategories['Category:Agony/Delta/Leadership'] = true;

// Content restricted to Echo Squadron Members
$wgAccessControlCategories['Category:Agony/Echo'] = true;
// Content restricted to Echo Squadron Admiral
$wgAccessControlCategories['Category:Agony/Echo/Leadership'] = true;

// PVP University categories
$wgAccessControlCategories['Category:PVP_University/BASIC'] = true;
$wgAccessControlCategories['Category:PVP_University_Instructor/BASIC'] = true;
$wgAccessControlCategories['Category:PVP_University/WOLFPACKS'] = true;
$wgAccessControlCategories['Category:PVP_University_Instructor/WOLFPACKS'] = true;
$wgAccessControlCategories['Category:PVP_University/COVOPS'] = true;
$wgAccessControlCategories['Category:PVP_University_Instructor/COVOPS'] = true;
$wgAccessControlCategories['Category:PVP_University/FLYBYS'] = true;
$wgAccessControlCategories['Category:PVP_University_Instructor/FLYBYS'] = true;
$wgAccessControlCategories['Category:PVP_University/ADVANCED'] = true;
$wgAccessControlCategories['Category:PVP_University_Instructor/ADVANCED'] = true;

// Create special namespaces for content that needs additional default protections
define('NS_AGONY', 100);
define('NS_AGONY_TALK', 101);

define('NS_INTEL', 102);
define('NS_INTEL_TALK', 103);

$wgExtraNamespaces[NS_AGONY] = "Agony";
$wgExtraNamespaces[NS_AGONY_TALK] = "Agony_talk";

$wgExtraNamespaces[NS_INTEL] = "Intel";
$wgExtraNamespaces[NS_INTEL_TALK] = "Intel_talk";

$wgNamespaceRobotPolicies[NS_AGONY] = 'noindex,nofollow';
$wgNamespaceRobotPolicies[NS_AGONY_TALK] = 'noindex,nofollow';
$wgNamespaceRobotPolicies[NS_INTEL] = 'noindex,nofollow';
$wgNamespaceRobotPolicies[NS_INTEL_TALK] = 'noindex,nofollow';

$wgNonincludableNamespaces[] = NS_AGONY;
$wgNonincludableNamespaces[] = NS_AGONY_TALK;
$wgNonincludableNamespaces[] = NS_INTEL;
$wgNonincludableNamespaces[] = NS_INTEL_TALK;

// Access to the pages in these namespaces require both namespace and category permissions.
// In other words, category permissions are insuficient to gain access to pages in these namespaces.
$wgExclusiveNamespaces[NS_IMAGE_TALK] = true;
$wgExclusiveNamespaces[NS_MEDIAWIKI] = true;
$wgExclusiveNamespaces[NS_MEDIAWIKI_TALK] = true;
$wgExclusiveNamespaces[NS_CATEGORY] = true;
$wgExclusiveNamespaces[NS_CATEGORY_TALK] = true;

$wgExclusiveNamespaces[NS_AGONY] = true;
$wgExclusiveNamespaces[NS_AGONY_TALK] = true;
$wgExclusiveNamespaces[NS_INTEL] = true;
$wgExclusiveNamespaces[NS_INTEL_TALK] = true;

// Allow sub pages for these additional namespaces
$wgNamespacesWithSubpages[NS_AGONY] = true;
$wgNamespacesWithSubpages[NS_INTEL] = true;

function _cat($name, $right)
{
	return "Category:{$name}_{$right}";
}
function _ns($ns, $right)
{
	return "Namespace:{$ns}_{$right}";
}

// anonymous users have NO default permissions
$wgGroupPermissions['*'				] 									= array();	// reset
$wgGroupPermissions['*'				][_cat('Public','read')]			= true;
$wgGroupPermissions['*'				][_ns(NS_HELP,'read')]				= true;
$wgGroupPermissions['*'				][_ns(NS_MAIN,'read')]				= true;
$wgGroupPermissions['*'				][_ns(NS_PROJECT,'read')]			= true;
$wgGroupPermissions['*'				][_ns(NS_CATEGORY,'read')]			= true;
$wgGroupPermissions['*'				][_ns(NS_CATEGORY,'talk')]			= true;
$wgGroupPermissions['*'				][_ns(NS_TEMPLATE,'read')]			= true;
$wgGroupPermissions['*'				][_ns(NS_TEMPLATE,'talk')]			= true;
$wgSpecialPageAccess['*']['Search'] = true;
$wgSpecialPageAccess['*']['Categories'] = true;

// Implicit group for all logged-in accounts (users with a valid drupal account)
$wgGroupPermissions['user'			] 									= array();	// reset

$wgGroupPermissions['sysop'			]['move'] 							= false;

// This just enables the edit and move tabs, it doesn't actually grant access
$wgGroupPermissions[AE_ENSIGN		]['read']							= true;
$wgGroupPermissions[AE_ENSIGN		]['edit']							= true;
$wgGroupPermissions[AE_ENSIGN		]['move']							= true;
$wgGroupPermissions[AE_ENSIGN		]['create']							= true;
$wgGroupPermissions[AE_ENSIGN		]['createpage']						= true;
$wgGroupPermissions[AE_ENSIGN		]['createtalk']						= true;

$wgGroupPermissions[AE_ENSIGN		][_cat('Agony','read')]				= true;
$wgGroupPermissions[AE_ENSIGN		][_cat('Agony','talk')]				= true;
$wgGroupPermissions[AE_ENSIGN		][_ns(NS_AGONY,'read')]				= true;
$wgGroupPermissions[AE_ENSIGN		][_ns(NS_AGONY,'talk')]				= true;
$wgGroupPermissions[AE_ENSIGN		][_ns(NS_CATEGORY,'read')]			= true;
$wgGroupPermissions[AE_ENSIGN		][_ns(NS_CATEGORY,'talk')]			= true;
$wgGroupPermissions[AE_ENSIGN		][_ns(NS_TEMPLATE,'edit')]			= true;
$wgGroupPermissions[AE_ENSIGN		][_ns(NS_TEMPLATE,'talk')]			= true;
$wgGroupPermissions[AE_ENSIGN		][_cat('Agony/Ensign','read')]		= true;
$wgGroupPermissions[AE_ENSIGN		][_cat('Agony/Ensign','edit')]		= true;
$wgGroupPermissions[AE_ENSIGN		][_cat('Agony/Ensign','move')]		= true;
$wgGroupPermissions[AE_ENSIGN		][_cat('Agony/Ensign','create')]	= true;
$wgGroupPermissions[AE_ENSIGN		][_cat('Agony/Ensign','createtalk')]= true;
$wgGroupPermissions[AE_ENSIGN		][_cat('Agony/Ensign','talk')]		= true;

$wgGroupPermissions[AE_LIEUTENANT	][_cat('Public','talk')]			= true;
$wgGroupPermissions[AE_LIEUTENANT	][_cat('Agony','createtalk')]		= true;
$wgGroupPermissions[AE_LIEUTENANT	][_ns(NS_AGONY,'createtalk')]		= true;
$wgGroupPermissions[AE_LIEUTENANT	][_ns(NS_CATEGORY,'createtalk')]	= true;
$wgGroupPermissions[AE_LIEUTENANT	][_ns(NS_TEMPLATE,'createtalk')]	= true;
$wgGroupPermissions[AE_LIEUTENANT	][_cat('Agony/Lieutenant','read')]	= true;
$wgGroupPermissions[AE_LIEUTENANT	][_cat('Agony/Lieutenant','edit')]	= true;
$wgGroupPermissions[AE_LIEUTENANT	][_cat('Agony/Lieutenant','move')]	= true;
$wgGroupPermissions[AE_LIEUTENANT	][_cat('Agony/Lieutenant','create')]= true;
$wgGroupPermissions[AE_LIEUTENANT	][_cat('Agony/Lieutenant','createtalk')]= true;
$wgGroupPermissions[AE_LIEUTENANT	][_cat('Agony/Lieutenant','talk')]	= true;

$wgGroupPermissions[AE_LT_COMMANDER	]['upload']							= true;
$wgGroupPermissions[AE_LT_COMMANDER	]['reupload']						= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Public','createtalk')]		= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Public','edit')]			= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Public','create')]			= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Public','move')]			= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Agony','edit')]				= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Agony','create')]			= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Agony','move')]				= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_ns(NS_AGONY,'edit')]				= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_ns(NS_AGONY,'create')]			= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Agony/Restricted','read')]	= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Agony/Restricted','edit')]	= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Agony/Restricted','create')]= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Agony/Restricted','move')]	= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_ns(NS_INTEL,'read')]				= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_ns(NS_INTEL,'edit')]				= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_ns(NS_INTEL,'create')]			= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_ns(NS_PROJECT,'talk')]			= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_ns(NS_PROJECT,'createtalk')]		= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_ns(NS_HELP,'edit')]				= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_ns(NS_HELP,'create')]			= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_ns(NS_HELP,'move')]				= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_ns(NS_HELP,'createtalk')]		= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_ns(NS_HELP,'talk')]				= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_ns(NS_CATEGORY,'edit')]			= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_ns(NS_CATEGORY,'create')]		= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_ns(NS_TEMPLATE,'edit')]			= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_ns(NS_TEMPLATE,'create')]		= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Agony/Ensign','delete')]		= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Agony/Lieutenant','delete')]	= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Agony/LtCommander','read')]		= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Agony/LtCommander','edit')]		= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Agony/LtCommander','move')]		= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Agony/LtCommander','create')]	= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Agony/LtCommander','createtalk')]= true;
$wgGroupPermissions[AE_LT_COMMANDER	][_cat('Agony/LtCommander','talk')]		= true;

$wgGroupPermissions[AE_COMMANDER		][_cat('Agony/Commander','read')]		= true;
$wgGroupPermissions[AE_COMMANDER		][_cat('Agony/Commander','edit')]		= true;
$wgGroupPermissions[AE_COMMANDER		][_cat('Agony/Commander','move')]		= true;
$wgGroupPermissions[AE_COMMANDER		][_cat('Agony/Commander','create')]		= true;
$wgGroupPermissions[AE_COMMANDER		][_cat('Agony/Commander','createtalk')]	= true;
$wgGroupPermissions[AE_COMMANDER		][_cat('Agony/Commander','talk')]		= true;

$wgGroupPermissions[AE_CAPTAIN		][_cat('Agony/Leadership','read')]	= true;
$wgGroupPermissions[AE_CAPTAIN		][_cat('Agony/Leadership','edit')]	= true;
$wgGroupPermissions[AE_CAPTAIN		][_cat('Agony/Leadership','create')]= true;
$wgGroupPermissions[AE_CAPTAIN		][_cat('Agony/Leadership','move')]	= true;
$wgGroupPermissions[AE_CAPTAIN		][_ns(NS_AGONY,'move')]				= true;
$wgGroupPermissions[AE_CAPTAIN		][_ns(NS_INTEL,'move')]				= true;
$wgGroupPermissions[AE_CAPTAIN		][_ns(NS_TEMPLATE,'move')]			= true;
$wgGroupPermissions[AE_CAPTAIN		][_cat('Agony/LtCommander','delete')]	= true;
$wgGroupPermissions[AE_CAPTAIN		][_cat('Agony/Commander','delete')]	= true;
$wgGroupPermissions[AE_CAPTAIN		][_cat('Agony/Captain','read')]		= true;
$wgGroupPermissions[AE_CAPTAIN		][_cat('Agony/Captain','edit')]		= true;
$wgGroupPermissions[AE_CAPTAIN		][_cat('Agony/Captain','move')]		= true;
$wgGroupPermissions[AE_CAPTAIN		][_cat('Agony/Captain','create')]	= true;
$wgGroupPermissions[AE_CAPTAIN		][_cat('Agony/Captain','createtalk')]= true;
$wgGroupPermissions[AE_CAPTAIN		][_cat('Agony/Captain','talk')]		= true;

$wgGroupPermissions[AE_VICE_ADMIRAL	][_cat('Public','delete')]					= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_cat('Agony','delete')]					= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_cat('Agony/Restricted','delete')]		= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_cat('Agony/Leadership','delete')]		= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_cat('Agony/Leadership/Senior','read')]	= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_cat('Agony/Leadership/Senior','edit')]	= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_cat('Agony/Leadership/Senior','create')]	= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_cat('Agony/Leadership/Senior','move')]	= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_cat('Agony/Leadership/Senior','delete')]	= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_ns(NS_AGONY,'delete')]					= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_ns(NS_INTEL,'delete')]					= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_ns(NS_PROJECT,'edit')]					= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_ns(NS_PROJECT,'move')]					= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_ns(NS_PROJECT,'create')]					= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_ns(NS_PROJECT,'delete')]					= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_ns(NS_TEMPLATE,'delete')]				= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_cat('Agony/Captain','delete')]			= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_cat('Agony/ViceAdmiral','read')]			= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_cat('Agony/ViceAdmiral','edit')]			= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_cat('Agony/ViceAdmiral','move')]			= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_cat('Agony/ViceAdmiral','create')]		= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_cat('Agony/ViceAdmiral','createtalk')]	= true;
$wgGroupPermissions[AE_VICE_ADMIRAL	][_cat('Agony/ViceAdmiral','talk')]			= true;

$wgGroupPermissions[AE_SQUADRON_ADMIRAL	][_cat('Agony/SquadronAdmiral','read')]			= true;
$wgGroupPermissions[AE_SQUADRON_ADMIRAL	][_cat('Agony/SquadronAdmiral','edit')]			= true;
$wgGroupPermissions[AE_SQUADRON_ADMIRAL	][_cat('Agony/SquadronAdmiral','move')]			= true;
$wgGroupPermissions[AE_SQUADRON_ADMIRAL	][_cat('Agony/SquadronAdmiral','create')]		= true;
$wgGroupPermissions[AE_SQUADRON_ADMIRAL	][_cat('Agony/SquadronAdmiral','createtalk')]	= true;
$wgGroupPermissions[AE_SQUADRON_ADMIRAL	][_cat('Agony/SquadronAdmiral','talk')]			= true;

$wgGroupPermissions[AE_OPS_ADMIRAL	][_cat('Agony/OperationsAdmiral','read')]		= true;
$wgGroupPermissions[AE_OPS_ADMIRAL	][_cat('Agony/OperationsAdmiral','edit')]		= true;
$wgGroupPermissions[AE_OPS_ADMIRAL	][_cat('Agony/OperationsAdmiral','move')]		= true;
$wgGroupPermissions[AE_OPS_ADMIRAL	][_cat('Agony/OperationsAdmiral','create')]		= true;
$wgGroupPermissions[AE_OPS_ADMIRAL	][_cat('Agony/OperationsAdmiral','createtalk')]	= true;
$wgGroupPermissions[AE_OPS_ADMIRAL	][_cat('Agony/OperationsAdmiral','talk')]		= true;

$wgGroupPermissions[AE_DIRECTOR		][_cat('*','read')]			= true;
$wgGroupPermissions[AE_DIRECTOR		][_cat('*','edit')]			= true;
$wgGroupPermissions[AE_DIRECTOR		][_cat('*','create')]		= true;
$wgGroupPermissions[AE_DIRECTOR		][_cat('*','move')]			= true;
$wgGroupPermissions[AE_DIRECTOR		][_cat('*','delete')]		= true;
$wgGroupPermissions[AE_DIRECTOR		][_cat('*','createtalk')]	= true;
$wgGroupPermissions[AE_DIRECTOR		][_cat('*','talk')]			= true;

$wgGroupPermissions[AE_DIRECTOR		][_ns('*','read')]			= true;
$wgGroupPermissions[AE_DIRECTOR		][_ns('*','edit')]			= true;
$wgGroupPermissions[AE_DIRECTOR		][_ns('*','create')]		= true;
$wgGroupPermissions[AE_DIRECTOR		][_ns('*','move')]			= true;
$wgGroupPermissions[AE_DIRECTOR		][_ns('*','delete')]		= true;
$wgGroupPermissions[AE_DIRECTOR		][_ns('*','createtalk')]	= true;
$wgGroupPermissions[AE_DIRECTOR		][_ns('*','talk')]			= true;

$wgGroupPermissions[AE_ALPHA_MEMBER	][_cat('Agony/Alpha','read')]				= true;
$wgGroupPermissions[AE_ALPHA_MEMBER	][_cat('Agony/Alpha','edit')]				= true;
$wgGroupPermissions[AE_ALPHA_MEMBER	][_cat('Agony/Alpha','create')] 			= true;
$wgGroupPermissions[AE_ALPHA_MEMBER	][_cat('Agony/Alpha','createtalk')] 		= true;
$wgGroupPermissions[AE_ALPHA_MEMBER	][_cat('Agony/Alpha','talk')] 				= true;

$wgGroupPermissions[AE_ALPHA_LEADER	][_cat('Agony/Alpha','move')]				= true;
$wgGroupPermissions[AE_ALPHA_LEADER	][_cat('Agony/Alpha','delete')]				= true;
$wgGroupPermissions[AE_ALPHA_LEADER	][_cat('Agony/Alpha/Leadership','read')]	= true;
$wgGroupPermissions[AE_ALPHA_LEADER	][_cat('Agony/Alpha/Leadership','edit')]	= true;
$wgGroupPermissions[AE_ALPHA_LEADER	][_cat('Agony/Alpha/Leadership','create')] 	= true;
$wgGroupPermissions[AE_ALPHA_LEADER	][_cat('Agony/Alpha/Leadership','talk')] 	= true;

$wgGroupPermissions[AE_BRAVO_MEMBER	][_cat('Agony/Bravo','read')]				= true;
$wgGroupPermissions[AE_BRAVO_MEMBER	][_cat('Agony/Bravo','edit')]				= true;
$wgGroupPermissions[AE_BRAVO_MEMBER	][_cat('Agony/Bravo','create')] 			= true;
$wgGroupPermissions[AE_BRAVO_MEMBER	][_cat('Agony/Bravo','createtalk')] 		= true;
$wgGroupPermissions[AE_BRAVO_MEMBER	][_cat('Agony/Bravo','talk')] 				= true;

$wgGroupPermissions[AE_BRAVO_LEADER	][_cat('Agony/Bravo','move')]				= true;
$wgGroupPermissions[AE_BRAVO_LEADER	][_cat('Agony/Bravo','delete')]				= true;
$wgGroupPermissions[AE_BRAVO_LEADER	][_cat('Agony/Bravo/Leadership','read')]	= true;
$wgGroupPermissions[AE_BRAVO_LEADER	][_cat('Agony/Bravo/Leadership','edit')]	= true;
$wgGroupPermissions[AE_BRAVO_LEADER	][_cat('Agony/Bravo/Leadership','create')] 	= true;
$wgGroupPermissions[AE_BRAVO_LEADER	][_cat('Agony/Bravo/Leadership','talk')] 	= true;

$wgGroupPermissions[AE_CHARLIE_MEMBER][_cat('Agony/Charlie','read')]				= true;
$wgGroupPermissions[AE_CHARLIE_MEMBER][_cat('Agony/Charlie','edit')]				= true;
$wgGroupPermissions[AE_CHARLIE_MEMBER][_cat('Agony/Charlie','create')] 			= true;
$wgGroupPermissions[AE_CHARLIE_MEMBER][_cat('Agony/Charlie','createtalk')] 		= true;
$wgGroupPermissions[AE_CHARLIE_MEMBER][_cat('Agony/Charlie','talk')] 			= true;

$wgGroupPermissions[AE_CHARLIE_LEADER][_cat('Agony/Charlie','move')]				= true;
$wgGroupPermissions[AE_CHARLIE_LEADER][_cat('Agony/Charlie','delete')]			= true;
$wgGroupPermissions[AE_CHARLIE_LEADER][_cat('Agony/Charlie/Leadership','read')]	= true;
$wgGroupPermissions[AE_CHARLIE_LEADER][_cat('Agony/Charlie/Leadership','edit')]	= true;
$wgGroupPermissions[AE_CHARLIE_LEADER][_cat('Agony/Charlie/Leadership','create')]= true;
$wgGroupPermissions[AE_CHARLIE_LEADER][_cat('Agony/Charlie/Leadership','talk')] 	= true;

$wgGroupPermissions[AE_DELTA_MEMBER	][_cat('Agony/Delta','read')]				= true;
$wgGroupPermissions[AE_DELTA_MEMBER	][_cat('Agony/Delta','edit')]				= true;
$wgGroupPermissions[AE_DELTA_MEMBER	][_cat('Agony/Delta','create')] 			= true;
$wgGroupPermissions[AE_DELTA_MEMBER	][_cat('Agony/Delta','createtalk')] 		= true;
$wgGroupPermissions[AE_DELTA_MEMBER	][_cat('Agony/Delta','talk')] 				= true;

$wgGroupPermissions[AE_DELTA_LEADER	][_cat('Agony/Delta','move')]				= true;
$wgGroupPermissions[AE_DELTA_LEADER	][_cat('Agony/Delta','delete')]				= true;
$wgGroupPermissions[AE_DELTA_LEADER	][_cat('Agony/Delta/Leadership','read')]	= true;
$wgGroupPermissions[AE_DELTA_LEADER	][_cat('Agony/Delta/Leadership','edit')]	= true;
$wgGroupPermissions[AE_DELTA_LEADER	][_cat('Agony/Delta/Leadership','create')] 	= true;
$wgGroupPermissions[AE_DELTA_LEADER	][_cat('Agony/Delta/Leadership','talk')] 	= true;

$wgGroupPermissions[AE_ECHO_MEMBER	][_cat('Agony/Echo','read')]				= true;
$wgGroupPermissions[AE_ECHO_MEMBER	][_cat('Agony/Echo','edit')]				= true;
$wgGroupPermissions[AE_ECHO_MEMBER	][_cat('Agony/Echo','create')] 				= true;
$wgGroupPermissions[AE_ECHO_MEMBER	][_cat('Agony/Echo','createtalk')] 			= true;
$wgGroupPermissions[AE_ECHO_MEMBER	][_cat('Agony/Echo','talk')] 				= true;

$wgGroupPermissions[AE_ECHO_LEADER	][_cat('Agony/Echo','move')]				= true;
$wgGroupPermissions[AE_ECHO_LEADER	][_cat('Agony/Echo','delete')]				= true;
$wgGroupPermissions[AE_ECHO_LEADER	][_cat('Agony/Echo/Leadership','read')]		= true;
$wgGroupPermissions[AE_ECHO_LEADER	][_cat('Agony/Echo/Leadership','edit')]		= true;
$wgGroupPermissions[AE_ECHO_LEADER	][_cat('Agony/Echo/Leadership','create')] 	= true;
$wgGroupPermissions[AE_ECHO_LEADER	][_cat('Agony/Echo/Leadership','talk')] 	= true;


$wgGroupPermissions[AE_BASIC_STUDENT		][_cat('PVP_University/BASIC','read')]			= true;
$wgGroupPermissions[AE_BASIC_STUDENT		][_cat('PVP_University/BASIC','talk')] 			= true;
$wgGroupPermissions[AE_BASIC_STUDENT		][_cat('PVP_University/BASIC','createtalk')]	= true;
$wgGroupPermissions[AE_BASIC_INSTRUCTOR		][_cat('PVP_University/BASIC','edit')]			= true;
$wgGroupPermissions[AE_BASIC_INSTRUCTOR		][_cat('PVP_University/BASIC','create')] 		= true;
$wgGroupPermissions[AE_BASIC_INSTRUCTOR		][_cat('PVP_University/BASIC','move')]			= true;
$wgGroupPermissions[AE_BASIC_INSTRUCTOR		][_cat('PVP_University/BASIC','talk')]			= true;
$wgGroupPermissions[AE_BASIC_INSTRUCTOR		][_cat('PVP_University/BASIC','createtalk')]			= true;
$wgGroupPermissions[AE_BASIC_INSTRUCTOR		][_cat('PVP_University_Instructor/BASIC','edit')]			= true;
$wgGroupPermissions[AE_BASIC_INSTRUCTOR		][_cat('PVP_University_Instructor/BASIC','create')] 		= true;
$wgGroupPermissions[AE_BASIC_INSTRUCTOR		][_cat('PVP_University_Instructor/BASIC','move')]			= true;
$wgGroupPermissions[AE_BASIC_INSTRUCTOR		][_cat('PVP_University_Instructor/BASIC','talk')]			= true;
$wgGroupPermissions[AE_BASIC_INSTRUCTOR		][_cat('PVP_University_Instructor/BASIC','createtalk')]			= true;

$wgGroupPermissions[AE_WOLFPACKS_STUDENT	][_cat('PVP_University/WOLFPACKS','read')]		= true;
$wgGroupPermissions[AE_WOLFPACKS_STUDENT	][_cat('PVP_University/WOLFPACKS','talk')] 		= true;
$wgGroupPermissions[AE_WOLFPACKS_STUDENT	][_cat('PVP_University/WOLFPACKS','createtalk')]= true;
$wgGroupPermissions[AE_WOLFPACKS_INSTRUCTOR	][_cat('PVP_University/WOLFPACKS','edit')]		= true;
$wgGroupPermissions[AE_WOLFPACKS_INSTRUCTOR	][_cat('PVP_University/WOLFPACKS','create')] 	= true;
$wgGroupPermissions[AE_WOLFPACKS_INSTRUCTOR	][_cat('PVP_University/WOLFPACKS','move')]		= true;
$wgGroupPermissions[AE_WOLFPACKS_INSTRUCTOR	][_cat('PVP_University/WOLFPACKS','talk')]		= true;
$wgGroupPermissions[AE_WOLFPACKS_INSTRUCTOR	][_cat('PVP_University/WOLFPACKS','createtalk')]		= true;
$wgGroupPermissions[AE_WOLFPACKS_INSTRUCTOR	][_cat('PVP_University_Instructor/WOLFPACKS','edit')]		= true;
$wgGroupPermissions[AE_WOLFPACKS_INSTRUCTOR	][_cat('PVP_University_Instructor/WOLFPACKS','create')] 	= true;
$wgGroupPermissions[AE_WOLFPACKS_INSTRUCTOR	][_cat('PVP_University_Instructor/WOLFPACKS','move')]		= true;
$wgGroupPermissions[AE_WOLFPACKS_INSTRUCTOR	][_cat('PVP_University_Instructor/WOLFPACKS','talk')]		= true;
$wgGroupPermissions[AE_WOLFPACKS_INSTRUCTOR	][_cat('PVP_University_Instructor/WOLFPACKS','createtalk')]		= true;

$wgGroupPermissions[AE_COVOPS_STUDENT		][_cat('PVP_University/COVOPS','read')]			= true;
$wgGroupPermissions[AE_COVOPS_STUDENT		][_cat('PVP_University/COVOPS','talk')] 		= true;
$wgGroupPermissions[AE_COVOPS_STUDENT		][_cat('PVP_University/COVOPS','createtalk')]	= true;
$wgGroupPermissions[AE_COVOPS_INSTRUCTOR		][_cat('PVP_University/COVOPS','edit')]			= true;
$wgGroupPermissions[AE_COVOPS_INSTRUCTOR		][_cat('PVP_University/COVOPS','create')] 		= true;
$wgGroupPermissions[AE_COVOPS_INSTRUCTOR		][_cat('PVP_University/COVOPS','move')]			= true;
$wgGroupPermissions[AE_COVOPS_INSTRUCTOR		][_cat('PVP_University/COVOPS','talk')]			= true;
$wgGroupPermissions[AE_COVOPS_INSTRUCTOR		][_cat('PVP_University/COVOPS','createtalk')]			= true;
$wgGroupPermissions[AE_COVOPS_INSTRUCTOR		][_cat('PVP_University_Instructor/COVOPS','edit')]			= true;
$wgGroupPermissions[AE_COVOPS_INSTRUCTOR		][_cat('PVP_University_Instructor/COVOPS','create')] 		= true;
$wgGroupPermissions[AE_COVOPS_INSTRUCTOR		][_cat('PVP_University_Instructor/COVOPS','move')]			= true;
$wgGroupPermissions[AE_COVOPS_INSTRUCTOR		][_cat('PVP_University_Instructor/COVOPS','talk')]			= true;
$wgGroupPermissions[AE_COVOPS_INSTRUCTOR		][_cat('PVP_University_Instructor/COVOPS','createtalk')]			= true;

$wgGroupPermissions[AE_FLYBYS_STUDENT		][_cat('PVP_University/FLYBYS','read')]			= true;
$wgGroupPermissions[AE_FLYBYS_STUDENT		][_cat('PVP_University/FLYBYS','talk')] 		= true;
$wgGroupPermissions[AE_FLYBYS_STUDENT		][_cat('PVP_University/FLYBYS','createtalk')]	= true;
$wgGroupPermissions[AE_FLYBYS_INSTRUCTOR		][_cat('PVP_University/FLYBYS','edit')]			= true;
$wgGroupPermissions[AE_FLYBYS_INSTRUCTOR		][_cat('PVP_University/FLYBYS','create')] 		= true;
$wgGroupPermissions[AE_FLYBYS_INSTRUCTOR		][_cat('PVP_University/FLYBYS','move')]			= true;
$wgGroupPermissions[AE_FLYBYS_INSTRUCTOR		][_cat('PVP_University/FLYBYS','talk')]			= true;
$wgGroupPermissions[AE_FLYBYS_INSTRUCTOR		][_cat('PVP_University/FLYBYS','createtalk')]			= true;
$wgGroupPermissions[AE_FLYBYS_INSTRUCTOR		][_cat('PVP_University_Instructor/FLYBYS','edit')]			= true;
$wgGroupPermissions[AE_FLYBYS_INSTRUCTOR		][_cat('PVP_University_Instructor/FLYBYS','create')] 		= true;
$wgGroupPermissions[AE_FLYBYS_INSTRUCTOR		][_cat('PVP_University_Instructor/FLYBYS','move')]			= true;
$wgGroupPermissions[AE_FLYBYS_INSTRUCTOR		][_cat('PVP_University_Instructor/FLYBYS','talk')]			= true;
$wgGroupPermissions[AE_FLYBYS_INSTRUCTOR		][_cat('PVP_University_Instructor/FLYBYS','createtalk')]			= true;

$wgGroupPermissions[AE_ADVANCED_STUDENT		][_cat('PVP_University/ADVANCED','read')]		= true;
$wgGroupPermissions[AE_ADVANCED_STUDENT		][_cat('PVP_University/ADVANCED','talk')] 		= true;
$wgGroupPermissions[AE_ADVANCED_STUDENT		][_cat('PVP_University/ADVANCED','createtalk')]	= true;
$wgGroupPermissions[AE_ADVANCED_INSTRUCTOR	][_cat('PVP_University/ADVANCED','edit')]		= true;
$wgGroupPermissions[AE_ADVANCED_INSTRUCTOR	][_cat('PVP_University/ADVANCED','create')] 	= true;
$wgGroupPermissions[AE_ADVANCED_INSTRUCTOR	][_cat('PVP_University/ADVANCED','move')]		= true;
$wgGroupPermissions[AE_ADVANCED_INSTRUCTOR	][_cat('PVP_University/ADVANCED','talk')]		= true;
$wgGroupPermissions[AE_ADVANCED_INSTRUCTOR	][_cat('PVP_University/ADVANCED','createtalk')]		= true;
$wgGroupPermissions[AE_ADVANCED_INSTRUCTOR	][_cat('PVP_University_Instructor/ADVANCED','edit')]		= true;
$wgGroupPermissions[AE_ADVANCED_INSTRUCTOR	][_cat('PVP_University_Instructor/ADVANCED','create')] 	= true;
$wgGroupPermissions[AE_ADVANCED_INSTRUCTOR	][_cat('PVP_University_Instructor/ADVANCED','move')]		= true;
$wgGroupPermissions[AE_ADVANCED_INSTRUCTOR	][_cat('PVP_University_Instructor/ADVANCED','talk')]		= true;
$wgGroupPermissions[AE_ADVANCED_INSTRUCTOR	][_cat('PVP_University_Instructor/ADVANCED','createtalk')]		= true;

// Allow lt_commander and up to access special pages
$wgSpecialPageAccess[AE_LT_COMMANDER]['Export'] = false;
$wgSpecialPageAccess[AE_LT_COMMANDER]['*'] = true;
// Only allow directors to use Export page
$wgSpecialPageAccess[AE_DIRECTOR]['Export'] = true;
?>